<?php $sessionUser = new Zend_Session_Namespace('sessionUser'); ?>
<h2>Which Long Term Patient Would You Like To Edit :</h2>
Search a user:
<?php
    echo $this->form ;
?>
<script type="text/javascript">
	function conf(url) {
	var answer = confirm("Do you want to delete this user?")
	if (answer){
		window.location = url;
	}
	
}
</script>
<table>
    <tr>
    	<th>Id</th>
        <th>Name</th>
        <th>Type</th>
        <th>Edit?</th>
        <th>Delete?</th>
    </tr>
    <?php foreach ($this->allusers as $a) : 
    	if (strcmp(strtoupper($a->UserType),"PATIENT") == 0){?>
        
        <tr>
           <td><?php echo $this->escape($a->UserId); ?> </td>  
           <td><?php echo $this->escape($a->LName); ?> <?php echo $this->escape($a->FName);?> </td>
           <td><?php echo $this->escape($a->UserType); ?></td>
           <td><a style="color:black;" href="<?php echo $this->url(array('controller' => 'secretary',
                           'action' => 'edituserpatient', 'userid' => $a->UserId)); ?>">Edit</a></td>
           <td><a style="text-decoration:underline; color:black; cursor:pointer;" onclick="<?php echo "conf('" . $this->url(array('controller' => 'secretary',
                           'action' => 'deleteuserpatient', 'userid' => $a->UserId)) . "')"; ?>">Delete</a></td>
        </tr>                                        
    <?php  }
    endforeach; ?>
</table>
